package com.myres.db.place;
import com.myres.db.ConnectionPool;
import com.myres.model.place.Zone;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;

public class PlaceAccessor {
    private Connection con;
    public void close() throws SQLException{
    	con.close();
    }
	public int insertZone(Zone zone) throws SQLException{
		con=ConnectionPool.getPool().getConnection();
		PreparedStatement pstmt=con.prepareStatement("insert into res_zones(Zone,Value) values(?,?)");
		pstmt.setString(1, zone.getZone());
		pstmt.setString(2, zone.getValue());
	    return 	pstmt.executeUpdate();
	}
	
}
